import http from "../utils/request";
import axios from "axios";
// 请求首页数据,直接把这个对象导出
export const getData = () => {
  return axios.get("/home/getData");
};

// 下面四个:用户管理-后端-网络请求接口
export const getUser = (params) => {
  return http.get("/user/get/", params);
};

export const createUser = (data) => {
  return http.post("/user/save", data);
};

export const deleteUser = (data) => {
  return http.post("/system/sysuser/delete", data);
};

export const updateUser = (data) => {
  return http.post("/user/update", data);
};

export const getMenu = (data) => {
 
  return http.post("/permission/getMenu", data);
};
// 导出这个
export const getDataList =(url,params) =>{
     return http.get(url,{
      params: params,
      headers:{
        "Content-Type":'application/json'
      }
     })
}
// 默认导出
export default {
  getData,
  getUser,
  createUser,
  deleteUser,
  updateUser,
  getMenu,
  getDataList
};